require(['./config'],()=>{
    require(['template','request','swiper','header','footer'],(template, request,Swiper)=>{
        class Cate{
            constructor(){
                this.init()
                this.Swiper()
                
            }
            init(){
                const id=window.location.hash.slice(1)
                request.getCategory(id).then(resp=>{
                    console.log(resp)
                    if(resp.code===200){
                        const { name }=resp.data.category
                        const { list }=resp.data.items
                        $('#goodsClassify').html(template('classifyTempalte',{name,list}))
                    }
                })
            }
            Swiper(){
                new Swiper('.swiper-container', {
                
                loop: true, // 循环模式选项
                
                // 如果需要分页器
                pagination: {
                  el: '.swiper-pagination',
                },
              })
            }
          
        }
        new Cate()
    })
})